/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */


package Controller;

import View.*;
import DAO.*;
import TO.BookTO;


/**
 *
 * @author admin-pc
 */
public class BookController implements BookListener {
    private View view;
    private Model model;
    
    DAOFactory daof = DAOFactory.getInstance();
    
    public BookController(View view, Model model) {
		this.view = view;
		this.model = model;
    }

    
    public void bookAdd(BookEvent event) {        
        daof.getBookDAO().add(new BookTO(event.getId(),event.getTitle(),event.getStatus()));
        
    }
    
    public void bookDelete (BookEvent event){
        daof.getBookDAO().delete(event.getId());
    }
    
    public void bookUpdate (BookEvent event){
        daof.getBookDAO().update(new BookTO(event.getId(),event.getTitle(),event.getStatus()));
    } 
    
    
}
